package com.wgzx.modbus.message;

import com.wgzx.modbus.entity.ModbusRsp;
import reactor.core.publisher.MonoSink;

public class SinkMsgListener implements MsgListener<ModbusRsp> {

    private MonoSink monoSink;

    public SinkMsgListener(MonoSink monoSink) {
        this.monoSink = monoSink;
    }

    @Override
    public void onSuccess(ModbusRsp rsp) {
        this.monoSink.success(rsp);
    }

    @Override
    public void onError(Throwable t) {
        this.monoSink.error(t);
    }
}
